#include "network.h"
#include "parser.h"
#include "dinic.h"
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>

int main(int argc, char *argv[]){

    int option_index = 0;
    bool get_flow = false;
    bool get_cut = false;
    bool get_aux = false;
    int c = 0;
	network n = NULL;
    
    static struct option long_options[] =
                 {
                   {"corte", no_argument, 0, 'c'},
                   {"flujo", no_argument, 0, 'f'},
                   {"verbose", no_argument, 0, 'v'},
                   {0, 0, 0, 0}
                 };

    while ((c=getopt_long(argc, argv, "cfv",long_options, 
            &option_index))!=-1)
            switch(c){
            case 'v':
                get_aux=true;
                break;
            case 'c':
                get_cut=true;
                break;
            case 'f':
                get_flow=true;
                break;
            default:
                exit(1);
    }
       
	n = command_in();

    dinic(n,get_flow,get_cut,get_aux);
    
    command_out(n, get_flow, get_cut, get_aux);
    
    network_destroy(n);
    
	return 0;
}
